'use strict';

function amount_even(collection) {

  //在这里写入代码
  let arr=[];
  for(let i of collection)
  {
    if(i%2===0)
    {
      arr.push(i);
    }
  }
  let result=arr. reduce(function(sum,x){
    return sum+x;
  },0);
  return result;
}


module.exports = amount_even;
